class TopLine extends React.Component {
    constructor(props) {
        super(props);

        this.state = {
            menuicon: !0,
        };
    }

    componentDidMount() {
        // checklogin(res=>{})
    }
    menuicon() {
        let { menuicon } = this.state
        this.setState({ menuicon: !menuicon })
    }
    quit() {
        $.cookie('token', "");
        window.location.href = './docshopunknwo.html'
    }

    render() {
        let { menuicon } = this.state
        return (
            <div className='topLine'>
                {/* <img className='bwv' src={Constant.LOGO} /> */}
                <div className="title">
                    <img className='' src={`./src/${menuicon ? 'menuleft' : 'menuright'}.png`} onClick={this.menuicon.bind(this)} />
                    建筑港后台管理系统
                </div>
                <div className='content'>
                    欢迎使用建筑港后台管理！
                    <a className='quita' onClick={this.quit}>退出登录</a>
                </div>

            </div>
        )
    }
}

class LeftMenu extends React.Component {
    constructor(props) {
        super(props);
        console.log(props, 'props');

        this.state = {
            category: this.props.category,
            code: this.props.code,
            class: this.props.class,
        };
    }


    componentDidMount() {

    }
    nav(e) {
        var path = `${e}.html`;
        window.location.href = path;
    }

    render() {
        return (
            <div className='LeftMenu'>
                <div onClick={this.nav.bind(this, 'banner')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'banner' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >轮播管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'types')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'types' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >分类管理</p>
                    </div>
                </div>
                标签管理
                <div onClick={this.nav.bind(this, 'recruit')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'recruit' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >招工管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'worktype')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'worktype' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >工种管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'companytype')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'companytype' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >公司类型管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'mechanicstype')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'mechanicstype' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >机械分类管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'bank')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'bank' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >开户行管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'hardware')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'hardware' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >五金管理</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'insurance')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'insurance' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >劳务保险</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'useguide')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'useguide' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >使用指南</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'agreement')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'agreement' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >用户协议</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'policy')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'policy' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >隐私政策</p>
                    </div>
                </div>
                <div onClick={this.nav.bind(this, 'guidelines')} className='rows'>
                    <div className={"category " + (`${this.state.code == 'guidelines' ? 'check' : ''}`)} >
                        <div className="img">
                            <img src='./src/lm_order.png' />
                        </div>
                        <p >操作指引</p>
                    </div>
                </div>




            </div >



        )
    }
}